The present invention relates to an image processing apparatus, and more particularly to the shading of a displayed body in the processing of three-dimensional image data.
It has been well known that when a three-dimensional body is displayed on a display device of a pattern processing apparatus, such as a CRT display, the displayed body is shaded on the basis of a light reflection model, to display the body just as it would appear in reality. Such a shading technique is described, for example, in the following publications.
Bui Tuong Phong, "Illumination for Computer Generated Pictures", Communications of ACM, 18(6), June 1975, pages 311 to 317.
J. D. Foly and A. Van Dam, "Fundamentals of Interactive Computer Graphics", Addison Wesely Publishing Company.
James F. Blinn, "Models of Light Reflection for Computer Synthesized Pictures", SIGGRAPH '77 Proceeding.
Although details of the shading technique are described in the above publications (particularly in the book by J. D. Foly and A. Van Dam), the principle of shading based upon a reflection model will be summarized below. FIG. 2 shows a reflection model used by J. F. Blinn. In FIG. 2, reference symbol N designates a unit vector normal to a reflecting surface (namely, the unit normal vector of the reflecting surface), L a unit vector starting from a reflecting point P and directed to a light source, V a unit vector starting from the reflecting point P and directed to a view point, and H a unit vector in the direction of the sum vector of the vectors L and V. Accordingly, the unit vector H is the bisector of an angle between the vector L and the vector V. According to this model, the light intensity I at the view point is expressed by the following equation: EQU I=I.sub.a K.sub.a +I.sub.p {K.sub.d (N.multidot.L)+K.sub.s (N.multidot.H).sup.n } (1)
when I.sub.a indicates the intensity of ambient light, K.sub.a a reflection coefficient for ambient light, I.sub.p the intensity of light from a light source, K.sub.d a diffuse reflection coefficient, K.sub.s a specular reflection coefficient, and n a numeral value varying in a range from 10 to 1,000, depending upon the roughness of the reflecting surface. Incidentally, a mark "." in the equation (1) indicates the inner product of vectors.
A three-dimensional body which is bounded by a curved surface and is to be displayed, is first approximated by a polyhedron having a plurality of polygonal facets each called a patch surface, and then a unit normal vector at each vertex of the polyhedron is determined. FIG. 3 shows a polyhedron, by which a to-be-displayed body is approximated. Referring to FIG. 3, a polyhedron 1 has patch surfaces 11 to 13, and the unit normal vectors of the patch surfaces 11, 12 and 13 are expressed by N.sub.11, N.sub.12 and N.sub.13, respectively. A unit normal vector N.sub.v at a vertex 14 is obtained by forming a unit vector along the average vector of the unit normal vectors N.sub.11, N.sub.12 and N.sub.13 of the patch surfaces 11, 12 and 13 which share the vertex 14. After the unit normal vectors at all vertices of the polyhedron have been determined in the above-mentioned manner, a unit normal vector at each point on an original curved surface corresponding to each patch surface is determined by the interpolation of a unit normal vector among vertices which define the patch surface. Then, the intensity of light reflected from each point on the surface of the to-be-displayed body toward the view point, that is, the brightness of each dot (namely, each pixel) on a display screen can be calculated from the equation (1). Thus, the surface of the displayed body can be shaded. Although the vector H is used in the above shading method, the vector V may be used instead of the vector H. In this case, substantially the same result as in the above method is obtained, but the calculation of light intensity at the view point becomes complicated.
In a conventional shading apparatus, the inner products (N.multidot.L) and (N.multidot.H) have been calculated for each dot, and then the equation (1) has been calculated. Accordingly, it takes a lot of time to complete a displayed pattern.